﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace Silvermoon.OpenGL.Native
{
    public static class NativeDisplay
    {
        [DllImport("coredll")]
        extern static IntPtr GetDC(IntPtr hwnd);

        /// <summary>
        /// Gets the default display.
        /// </summary>
        public static IntPtr Default { get { return IntPtr.Zero; } } // GetDC(IntPtr.Zero);

        /// <summary>
        /// Gets the display from the specified control.
        /// </summary>
        /// <param name="control">WinForm control.</param>
        /// <returns>Native Display pointer.</returns>
        public static IntPtr FromControl(System.Windows.Forms.Control control)
        {
            return GetDC(control.Handle);
        }

    }
}
